<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html>
  <base href="${APP_PATH}/">
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>个人信息页面</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="public/css/bootstrap.min.css" rel="stylesheet">
<link href="public/css/materialdesignicons.min.css" rel="stylesheet">
<link href="public/css/style.min.css" rel="stylesheet">




</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
     <jsp:include page="/menu.jsp"></jsp:include>
    <!--End 左侧导航-->
    
    <!--头部信息-->
     <jsp:include page="/head.jsp"></jsp:include>
    <!--End 头部信息-->
    
    <!--页面主要内容-->
       <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-md-6 col-md-push-3">
            <div class="card">
              <div class="card-header"><h4>用户个人信息</h4></div>
              <div class="card-body">
                
                <form class="form-horizontal"  id="userInfo" method="post" >
                                      
                  <input type="hidden" id="uid" name="uid"   />
                  <div class="form-group">
                    <label class="col-xs-12" for="example-text-input">学号</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="sno" name="sno"  disabled="disabled" >
<!--                       <div class="help-block">输入更多信息</div> -->
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-xs-12" for="example-email-input">姓名</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="uname" name="uname"  disabled="disabled" >
                    </div>
                  </div>
                
                  <div class="form-group">
                    <label class="col-xs-12" for="example-password-input">班级</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="classes" name="classes"  disabled="disabled" >
                    </div>
                  </div>
                    <div class="form-group">
                    <label class="col-xs-12" for="example-password-input">用户状态</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="ustatus" name="ustatus"  disabled="disabled" >
                    </div>
                  </div>
                  
                 <div class="form-group">
                    <label class="col-xs-12" for="example-email-input">性别</label>
                    <div class="col-xs-12" >
                                                          男 <input  type="radio" id="male" name="gender" value="男">
                                                          女<input  type="radio" id="female" name="gender" value="女">
                    </div>
                  </div>
                     <div class="form-group">
                    <label class="col-xs-12" for="example-email-input">学历</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="education" name="education" >
                    </div>
                  </div>
                    <div class="form-group">
                    <label class="col-xs-12" for="example-email-input">城市</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="city" name="city" >
                    </div>
                  </div>
                    <div class="form-group">
                    <label class="col-xs-12" for="example-email-input">出生年月</label>
                    <div class="col-xs-12">
                      <input class="form-control" type="text" id="birthdate" name="birthdate" >
                    </div>
                  </div>
                
                <div class="form-group">
                    <div class="col-xs-12">
                      <button class="btn btn-primary" onclick="edit()" type="button">提交</button>   
                      <button class="btn btn-primary" onclick="reload()" type="button">取消</button>
                    </div>
                    </div>
             
                
                </form>
                </div>
                </div>
                </div>
                </div>
                </div>
      
    </main>
    <!--End 页面主要内容-->
</div>
</div>

<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script type="text/javascript" src="public/js/bootstrap.min.js"></script>
<script type="text/javascript" src="public/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="public/js/main.min.js"></script>
<script type="text/javascript" src="public/js/Chart.js"></script>




<script type="text/javascript">

/*****************************************************/
$(function(){
	
	$.ajax({
		url:"${APP_PATH}/userInfo/info/indexDo",
		type:"post",
		success:function(data){
			show(data)			
		}
	})
	
})


/*****************************************************/
/*****************************************************/


function show(data){
	$("#uid").val(data.loginUser.uid);
	$("#sno").val(data.loginUser.sno);
	$("#uname").val(data.loginUser.uname);
	$("#classes").val(data.classes);
	$("#ustatus").val(data.loginUser.ustatus);
	
	if(data.loginUser.gender=="男"){
		 $("#male").attr("checked",true)
	}else if(data.loginUser.gender=="女"){
		$("#female").attr("checked",true);
	}
	$("#education").val(data.loginUser.education);
	$("#city").val(data.loginUser.city);
	$("#birthdate").val(data.loginUser.birthdate);

}
/*****************************************************/


function edit(){
	$.ajax({
		url:"${APP_PATH}/userInfo/info/edit",
		type:"post",
		data:$("#userInfo").serialize(),
		success:function(data){
			window.location.reload();			
		}
	})
}


/*****************************************************/
/*****************************************************/

function reload(){
	window.location.reload();
}

/*****************************************************/

</script>
</body>
</html>